package com.mlink.ai.chat.utils

import android.app.PendingIntent
import android.os.Build

object IntentUtil {

    /**
     * 适配 target 31
     */
    fun pendingIntentFlagCompat(): Int {
        return if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.S)
            PendingIntent.FLAG_UPDATE_CURRENT or PendingIntent.FLAG_IMMUTABLE
        else PendingIntent.FLAG_UPDATE_CURRENT
    }
}